// 引入依赖
import Vue from 'vue'
import VueRouter from 'vue-router'

// 使用路由中间件
Vue.use(VueRouter)

// 懒加载引入组件
const index = () => import('../view/homepage.vue')
const logon = () => import('../view/Logon.vue')
const retrievePassword = () => import('../view/RetrievePassword.vue')
const Search = () => import('../view/Search.vue')
const FlightInformation = () => import('../view/FlightInformation.vue')
const PersonalInformation = () => import('../view/PersonalInformation.vue')
const TicketInformation = () => import('../view/TicketInformation.vue')
const PaymentCompleted = () => import('../view/PaymentCompleted.vue')
const map = () => import('../view/map.vue')
const TourismSharing = () => import('../view/TourismSharing.vue')

// 路由表
const routes = [
	{
    path: '/', component: index, meta: {
        title: '首页'
    }
},
{
    path: '/Logon', component: logon, meta: {
        title: '用户注册'
    }
},
{
    path: '/retrievePwd', component: retrievePassword, meta: {
        title: '找回密码'
    }
},
{
    path: '/Search', component: Search, meta: {
        title: '查询机票'
    }
},
{
    path: '/FlightInformation', component: FlightInformation, meta: {
        title: '乘机信息'
    }
},
{
    path: '/myinfo', component: PersonalInformation, meta: {
        title: '个人信息'
    }
},
{
    path: '/TicketInformation', component: TicketInformation, meta: {
        title: '确认信息'
    }
},
{
    path: '/PaymentCompleted', component: PaymentCompleted, meta: {
        title: '支付完成'
    }
},
{
    path: '/MapQuery', component: map, meta: {
        title: '特价机票'
    }
},
,
{
    path: '/TourismSharing', component: TourismSharing, meta: {
        title: '文章编辑'
    }
}
]


// 修改路由模式
const router = new VueRouter({
    mode: 'history', base: process.env.BASE_URL, routes
})

//暴露
export default router
